local skill1 = fk.CreateSkill({
  name = "pc__benshi",
})

Fk:loadTranslationTable{
  ["pc__benshi"] = "奔矢",
  [":pc__benshi"] = "出牌阶段开始时，你可以令你本回合使用的下一张牌无效，若如此做，你本阶段使用【杀】无距离次数限制。",
  ["$pc__benshi1"] = "匣中龙剑鸣，夜夜欲腾凌。",
  ["$pc__benshi2"] = "铁衣结霜棱，战血蚀断戈。",
  ["@@pc__benshi_targetmod-phase"] = "奔矢 无距离次数限制",
  ["@@pc__benshi-turn"] = "奔矢 使用牌无效",
}

skill1:addEffect(fk.EventPhaseStart, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(skill1.name) and player.phase == Player.Play
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    room:addPlayerMark(player, "@@pc__benshi_targetmod-phase")
    room:addPlayerMark(player, "@@pc__benshi-turn")
  end,
})
skill1:addEffect(fk.AfterCardUseDeclared, {
  mute = true,
  can_refresh = function (self, event, target, player, data)
    return target == player and player:getMark("@@pc__benshi-turn") > 0
  end,
  on_refresh = function (self, event, target, player, data)
    local room = player.room
    room:setPlayerMark(player, "@@pc__benshi-turn", 0)
    if data.toCard then
      data.toCard = nil
    else
      data.tos = {}
    end
  end,
})
skill1:addEffect("targetmod", {
  bypass_times = function(self, player, skill, scope, card)
    return card and card.trueName == "slash" and player:getMark("@@pc__benshi_targetmod-phase") > 0
  end,
  bypass_distances =  function(self, player, skill, card, to)
    return card and card.trueName == "slash" and player:getMark("@@pc__benshi_targetmod-phase") > 0
  end,
})
return skill1

